import request from '@/utils/request'

// 获取商品列表
export function getGoodsList() {
  return request({
    url: '/goods/list',
    method: 'get'
  })
}

// 添加商品
export function addGoods(data) {
  return request({
    url: '/goods/add',
    method: 'post',
    data
  })
}

// 获取商品详情
export function getGoodsDetail(goodsId) {
  return request({
    url: `/goods/${goodsId}`,
    method: 'get'
  })
}

// 更新商品
export function updateGoods(data) {
  return request({
    url: '/goods/update',
    method: 'put',
    data
  })
}

// 删除商品
export function deleteGoods(goodsId) {
  return request({
    url: `/goods/delete/${goodsId}`,
    method: 'delete'
  })
} 